﻿<UserControl x:Class="Shatkotha.WPF.Global.Common.Controls.Dialog.DialogView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:global="clr-namespace:Shatkotha.WPF.Global"
    xmlns:Dialog="clr-namespace:Shatkotha.WPF.Global.Common.Controls.Dialog"
    Height="Auto" Width="Auto">
    
    <StackPanel Orientation="Vertical">
        <Border CornerRadius="5" Background="White" BorderThickness="1" BorderBrush="Gray" Margin="12">
            <Border.BitmapEffect>                
                <DropShadowBitmapEffect/>
            </Border.BitmapEffect>
            <StackPanel>
                <Border Height="32" Margin="0,0,0,0" CornerRadius="7 7 0 0" Visibility="{Binding TitleBarVisibility}" Background="{DynamicResource DialogTitleBarBGBrush}">                    
                    <Grid x:Name="titlePanel">
                        <Image x:Name="DialogIcon" HorizontalAlignment="Left" Height="16" Margin="5,0,0,0"></Image>
                        <Thumb x:Name="moveThumb" BorderThickness="0" BorderBrush="Transparent" HorizontalAlignment="Stretch" Tag="{Binding Title}" Cursor="ScrollAll" DragDelta="moveThumb_DragDelta" Background="Transparent"/>
                        <Button MinHeight="16" MinWidth="16" Style="{DynamicResource DialogCloseButtonStyle}"  Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.Cancel}" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="0" Margin="5,0" Background="Transparent" Cursor="Hand">
                        </Button>
                    </Grid>
                </Border>
                <Rectangle Fill="#ffffff" StrokeThickness="0"  Margin="0,0,0,0" VerticalAlignment="Top" Height="1" Visibility="{Binding TitleBarVisibility}"/>
                <Rectangle Fill="#cfd8da" StrokeThickness="0"  Margin="0,0,0,0" VerticalAlignment="Top" Height="1" Visibility="{Binding TitleBarVisibility}"/>
                <Border Style="{DynamicResource  FrameBKPanel}">
                    <StackPanel >
                        <ContentControl Content="{Binding UserView}" />
                        <Rectangle Fill="#cfd8da" StrokeThickness="0"  Margin="0,10,0,0" VerticalAlignment="Top" Height="1" Visibility="{Binding CommandPanelVisibility}" />
                        <Rectangle Fill="#ffffff" StrokeThickness="0"  Margin="0,0,0,0" VerticalAlignment="Top" Height="1" Visibility="{Binding CommandPanelVisibility}" />
                        <StackPanel  HorizontalAlignment="Right" Orientation="Horizontal" Margin="10" Visibility="{Binding CommandPanelVisibility}" >                                                    
                            <Button 
                                MinHeight="30" MinWidth="60"
                                Style="{DynamicResource  Level1SecondaryButtonStyle}" 
                                Command="{Binding DialogCommand}" 
                                CommandParameter="{x:Static Dialog:DialogResult.Cancel}" 
                                Visibility="{Binding CancelButtonVisibility}" 
                                Content="{Binding CancelButtonCaption}" 
                                HorizontalAlignment="Right"
                                />
                            <TextBlock Style="{DynamicResource OrTextBlockStyle}" Margin="5,0" Visibility="{Binding CancelButtonVisibility}" Text="{x:Static global:StringTable.OrCaption}" VerticalAlignment="Center"/>
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1PrimaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.OK}"  Visibility="{Binding OkButtonVisibility}" Content="{Binding OkButtonCaption}" HorizontalAlignment="Right"/>
                            
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1SecondaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.No}" Visibility="{Binding NoButtonVisibility}" Content="{Binding NoButtonCaption}" HorizontalAlignment="Right" />                            
                            <TextBlock Style="{DynamicResource OrTextBlockStyle}" Margin="5,0" Visibility="{Binding NoButtonVisibility}" Text="{x:Static global:StringTable.OrCaption}"  VerticalAlignment="Center"/>
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1PrimaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.Yes}" Visibility="{Binding YesButtonVisibility}" Content="{Binding YesButtonCaption}" HorizontalAlignment="Right" />
                            
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1SecondaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.Ignore}" Visibility="{Binding IgnoreButtonVisibility}" HorizontalAlignment="Right" Content="{Binding IgnoreButtonCaption}" />                            
                            <TextBlock Style="{DynamicResource OrTextBlockStyle}" Margin="5,0" Visibility="{Binding IgnoreButtonVisibility}" Text="{x:Static global:StringTable.OrCaption}"  VerticalAlignment="Center"/>
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1SecondaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.Abort}" Visibility="{Binding AbortButtonVisibility}" HorizontalAlignment="Right" Content="{Binding AbortButtonCaption}" />                            
                            <TextBlock Style="{DynamicResource OrTextBlockStyle}" Margin="5,0" Visibility="{Binding AbortButtonVisibility}" Text="{x:Static global:StringTable.OrCaption}"  VerticalAlignment="Center"/>
                            <Button MinHeight="30" MinWidth="60" Style="{DynamicResource  Level1PrimaryButtonStyle}" Command="{Binding DialogCommand}" CommandParameter="{x:Static Dialog:DialogResult.Retry}" Visibility="{Binding RetryButtonVisibility}" HorizontalAlignment="Right" Content="{Binding RetryButtonCaption}" />                            
                        </StackPanel>
                    </StackPanel>
                </Border>
            </StackPanel>
        </Border>
    </StackPanel>
</UserControl>
